from sqlalchemy import Table, MetaData, Column, Integer, String, ForeignKey
from sqlalchemy.orm import registry
mapper_registry = registry()
Base = mapper_registry.generate_base()

#企业信息表
class Companies(Base):
    __tablename__ = "companies"

    cp_id = Column(String(32), primary_key=True)

    cp_name = Column(String(30))

    cp_phone = Column(String(11))

    address = Column(String(64))

#     初始化
    def __init__(self,cp_id=None,cp_name=None,cp_phone=None,address=None):
        self.cp_id = cp_id
        self.cp_name = cp_name
        self.cp_phone = cp_phone
        self.address = address

    def format_str(self):
        return  "cp_id:%s,cp_name:%s,cp_phone:%s,address:%s" % (self.cp_id,self.cp_name,self.cp_phone,self.address)










